import { createApp } from "vue";
import SvgIcon from "@/icons/SvgIcon";
import App from "@/App";

const app = createApp(App);
app.component("svg-icon", {
  template: SvgIcon
});

/**
 * require.contex: 读取指定目录的所有文件
 * true: 便利子级目录
 * 定义遍历文件规则
 */
const req = require.context("./svg", false, /\.svg$/);
const requireAll = requireContext => {
  return requireContext.keys().map(requireContext);
};
requireAll(req);
